package com.lc.tgxm.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.lc.tgxm.R;
import com.lc.tgxm.model.Msg;
import com.zcx.helper.adapter.AppHolderAdapter;
import com.zcx.helper.bound.BoundView;

import java.util.List;

/**
 * MListAdapter 销售简报的Adapter
 * Created by Lei on 2016/12/19.
 */
public class MListAdapter extends AppHolderAdapter<Msg, MListAdapter.ViewHolder> {

    public MListAdapter(Context context, List<Msg> objects) {
        super(context, objects);
    }

    public static class ViewHolder extends AppHolderAdapter.ViewHolder<Msg> {
        @BoundView(R.id.tv_title)
        private TextView tvTitle;
        @BoundView(R.id.tv_line_1)
        private TextView tvMsg;

        protected ViewHolder(AppHolderAdapter appHolderAdapter) {
            super(appHolderAdapter);
        }

        @Override
        protected int resourceId() {
            return R.layout.item_mlv;
        }

        @Override
        protected void load(Context context, int i, View view, Msg o) {
            tvTitle.setText(o.title);
            tvMsg.setText(o.msg);
        }

    }

}